<%@page import="java.io.PrintWriter"%>
<%@page import="java.net.URLEncoder"%>
<%@page import="java.net.URL"%>
<%@page import="java.net.URLConnection"%>
<%@page import="java.util.Enumeration"%>
<%

String acceso = request.getAttribute("acceso").toString();

if (acceso.equalsIgnoreCase("X")){

String ParameterNames = "";
String parms = "";
for (Enumeration e = request.getParameterNames();
        e.hasMoreElements();) {
    ParameterNames = (String) e.nextElement();
    if (!ParameterNames.equalsIgnoreCase("page")){
    parms += ParameterNames + "=" + request.getParameter(ParameterNames) + "&";
    }
} 
//response.sendRedirect(request.getParameter("page") + "?" + parms); 
String url = "/"+request.getParameter("page") + "?" + parms;
RequestDispatcher dispatcher = request.getServletContext().getRequestDispatcher(url);
dispatcher.forward(request, response);
}
else {
%>
<script type="text/javascript">
ShowError('El usuario actual no tiene acceso a este recurso');
</script>
<%	
}
%>